﻿using System;
using System.Collections.Generic;
using System.Text;

public class View : ObjectData
{
    public uint _nViewId = 0;
    private uint _nType = 0;
    private uint _nCapacity = 0;

    public View(uint nViewId, uint nType, uint nCapacity)
        : base(null, "View" + nViewId)
    {
        _nViewId = nViewId;
        _nType = nType;
        _nCapacity = nCapacity;
    }

    public void ViewAdd(int nObjectId, uint nCount, ByteArrayEx msg)
    {
        ObjectData tobj = new ViewObject(this, nObjectId.ToString());
        //tobj.setPropertiesFormByteArrayEx(nCount,msg);
        HandlePropertiesEx(nObjectId.ToString(), tobj);
    }

    public void ViewRemove(uint nObjectId)
    {
        if (CheckProperties(nObjectId.ToString()))
        {
            DeletePropertiesEx(nObjectId.ToString());
        }
    }

    public void ViewObjProperty(uint nObjectId, uint nCount, ByteArrayEx msg)
    {
        if (CheckProperties(nObjectId.ToString()))
        {

            ViewObject tobj = (ViewObject)GetProperties(nObjectId.ToString());
            //tobj.setPropertiesFormByteArrayEx(nCount,msg);
            UpdataPropertiesEx(nObjectId.ToString(), tobj);
        }
    }

    public void Clear()
    {
        //清掉视图内容
        this.clearProperties();
    }
}
